<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ATM</title>
    <script>
        money = 100
        while (true) {
            fun = prompt('请输入您要进行的操作：\n1.存钱\n2.取钱\n3.显示余额\n4.退出') 
            if (fun == '1') {
                save = parseFloat(prompt('请输入您要存的钱数'))
                money += save
                alert('存完余额为' + money)
            } else if (fun == '2') {
                take = parseFloat(prompt('请输入您要取的钱数'))
                remian = money - take
                if (remian < 0) {
                    alert('余额不足')
                } else {
                    money = remian
                    alert('取完余额为' + money)
                }
            } else if (fun == '3') {
                alert('余额为' +  money)
            } else {
                break
            }

        }
    </script>
</head>
<body>

</body>
</html>